package data.missions;

import data.tileables.Controllable;

public class PowerUp extends Mission{
	protected int ticksLeft;
	public PowerUp()
	{
		displayName = "Power Up";
		ticksLeft = 10;
	}
	public PowerUp(Controllable c)
	{		
		thisControllable = c;
		ticksLeft = 10;
		displayName = "Power Up";
	}
	public int execute()
	{
		if(thisControllable.getState() == 0)
		{
			if(ticksLeft > 0)
			{
				ticksLeft--;
				return 0;
			}
			else
			{
				thisControllable.setState(true);
				return 1;
			}
		}
		return 1;
	}
	
	
	public String getName()
	{
		return super.getName()+" in: "+this.ticksLeft;
	}
}
